<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.bdqn.newdream.javabean.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>问题详情</title>
    <!-- 背景 -->
    <script type="text/javascript" defer="" async="" src="file/js/Template.js"></script>
	<script type="text/javascript" defer="" async="" src="file/js/Special_effect.js"></script>
	<link rel="stylesheet" href="file/css/Template.css">
    <!-- -- -->

<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="keywords" content="fly,layui,前端社区">
<meta name="description" content="">
<link rel="stylesheet" href="file/res/layui/css/layui.css">
<link rel="stylesheet" href="file/res/css/global.css">
<script src="file/res/layui/layui.js"></script>
<script src="file/js/jquery-1.7.2.min.js"></script>


<style type="text/css" rel="stylesheet">
form {
	margin: 0;
}

.editor {
	margin-top: 5px;
	margin-bottom: 5px;
}
</style>
    <!-- -- -->
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
  <script>"undefined"==typeof CODE_LIVE&&(!function(e){var t={nonSecure:"56517",secure:"56522"},c={nonSecure:"http://",secure:"https://"},r={nonSecure:"127.0.0.1",secure:"gapdebug.local.genuitec.com"},n="https:"===window.location.protocol?"secure":"nonSecure";script=e.createElement("script"),script.type="text/javascript",script.async=!0,script.src=c[n]+r[n]+":"+t[n]+"/codelive-assets/bundle.js",e.getElementsByTagName("head")[0].appendChild(script)}(document),CODE_LIVE=!0);</script></head>
  
  <body data-genuitec-lp-enabled="false" data-genuitec-file-id="wc1-27" data-genuitec-path="/dreaming/WebRoot/WEB-INF/jsp/myjsp.jsp">
	<canvas id="sakura" width="1366" height="1006" data-genuitec-lp-enabled="false" data-genuitec-file-id="wc1-27" data-genuitec-path="/dreaming/WebRoot/WEB-INF/jsp/myjsp.jsp"></canvas>
	<div class="btnbg">
		<!-- 之外代码都是背景代码-->
        	<div class="header">
			<div class="main">
				<a class="title" href="main" title="新梦想">新梦想社区</a>
				<div class="nav">
					<a class="nav-this" href="main">
						<i class="iconfont icon-wenda"></i>你问我答</a>
				</div>
				<div class="nav-user">
					<!-- 登入后的状态 -->
					<a class="avatar">
						<img src="<%=((DreamingUser)session.getAttribute("user"))==null?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/userimg/u=2269676958,3475806430&fm=214&gp=0.jpg":((DreamingUser)session.getAttribute("user")).getMessage().getImg()%>">
						<cite href=""><%=((DreamingUser)session.getAttribute("user"))==null?"<a href='login'>请登陆</a>":((DreamingUser)session.getAttribute("user")).getMessage().getNickname()%></cite>
					</a>
					<div class="nav">
						<a href="quit"><i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>注销</a>
					</div>
				</div>
			</div>
		</div>



	<div class="main layui-clear">
		<div class="wrap">
			<div class="content detail">
				<div class="fly-panel detail-box">
					<h1>${aprobleam.title}</h1>
					<div class="fly-tip fly-detail-hint" data-id="">
							<c:if test="${not empty aprobleam.reid}">
								<span class="fly-tip-stick">置顶帖</span>
								<span class="layui-btn layui-btn-mini jie-admin"> <a href="didt/${aprobleam.reid}?pid=${aprobleam.id}">取消置顶</a>
								</span> 
							</c:if>
							
						<c:if test="${empty aprobleam.reid&&not empty user}">
			 				<span class="jie-admin"> 
								<a href="sidt/${aprobleam.id}">点击置顶</a> </span> 
			 			</c:if>
			 			<c:if test="${aprobleam.uid==user.id&&not empty user}">
			 				<span class="jie-admin" type="del" style="margin-left: 20px;">
							<a href="dprobleam/${aprobleam.id}">删除该帖</a> </span> 
							</span>
			 			</c:if>
						<span class="fly-tip-stick">小主，要点赞哟!</span>
						<div class="fly-list-hint">
							<i class="iconfont" title="回答">&#xe60c;</i><c:out escapeXml="false" value='${aprobleam.count}'></c:out>
						</div>
					</div>
					
					
					
					
					<div class="detail-about">
						<a class="jie-user" href="">
						<img src="${aprobleam.message.img}" alt="头像"> <cite>
							${aprobleam.message.nickname}
								<em>${aprobleam.time}发布</em> </cite> </a>
						<div class="detail-hits" data-id="{{rows.id}}">
							 <span class="layui-btn layui-btn-mini jie-admin"><a
								>已完帖，无法编辑</a> </span>
							<c:if test="${empty aprobleam.cid&&not empty user}">
								<span class="layui-btn layui-btn-mini jie-admin" type="collect" data-type="add">
								  <a href="scollect/${aprobleam.id}">收藏</a> 
								  </span> 
							</c:if>
								<c:if test="${not empty aprobleam.cid&&not empty user}">
								 	<span class="layui-btn layui-btn-mini jie-admin  layui-btn-danger"
									type="collect" data-type="add"> <a href="dcollect/${aprobleam.cid}?pid=${aprobleam.id}">取消收藏</a>
									 </span>
								</c:if>
								
						</div>
					</div>
					<div class="detail-body photos" style="margin-bottom: 20px;">
						<p>
							<c:out escapeXml="false" value='${aprobleam.text}'></c:out>
						</p>
						
					</div>
				</div>
				<div class="fly-panel detail-box" style="padding-top: 0;">
					<a name="comment"></a>
					<ul class="jieda photos" id="jieda">
					
					
					
					<c:forEach items="${aprobleam.comment}" var="item">
						<c:out escapeXml="false" value='<li data-id="${item.id}" class="jieda-daan">'></c:out>
						<c:out escapeXml="false" value='<div class="detail-about detail-about-reply">'></c:out>
						<c:out escapeXml="false" value='<a class="jie-user" href="">'></c:out>
						<c:out escapeXml="false" value=' <img src="${item.message.img}" alt=""> <cite> <i>${item.message.nickname}</i>'></c:out>
						
						
						<c:if test="${item.message.uid==aprobleam.uid}">
							<c:out escapeXml="false" value='<em>(楼主)</em>'></c:out>
						</c:if>
						
						
						
						
						
						
						
						
						<c:out escapeXml="false" value='</cite> </a>'></c:out>
						<c:out escapeXml="false" value='<div class="detail-hits"><span>${item.time}</span></div>'></c:out>
						
						<c:if test="${not empty item.aid}">
							<c:out escapeXml="false" value='<i class="iconfont icon-caina" title="最佳答案"></i>'></c:out>
						</c:if>
					
						<c:out escapeXml="false" value='</div>'></c:out>
						<c:out escapeXml="false" value='<div class="detail-body jieda-body">'></c:out>
						<c:out escapeXml="false" value='<p>'></c:out>
						<c:out escapeXml="false" value='${item.text}'></c:out>
						<c:out escapeXml="false" value='</p>'></c:out>
						<c:out escapeXml="false" value='</div>'></c:out>
						<c:out escapeXml="false" value='<div class="jieda-reply">'></c:out>
						
						
						
						
						
						
						
						
						
						
						


							<c:if test="${not empty item.relikeid}">
								<span class="jieda-zan zanok" type="zan" data-cid="${item.id}" data-likeid="1">
								<i class="iconfont icon-zan"></i><em class="tempzan">${item.count}</em>
								</span>
							</c:if>

							<c:if test="${empty item.relikeid}">
								<span class="jieda-zan" type="zan" data-cid="${item.id}" data-likeid="2">
								<i class="iconfont icon-zan"></i><em class="tempzan">${item.count}</em>
								</span>
							</c:if>
						
		
							
						
						
						
						
						
						
						
						
						
						
						
						<c:out escapeXml="false" value='<div class="jieda-admin">'></c:out>
						<c:if test="${(user.id==aprobleam.uid&&empty item.aid)||(user.id==item.message.id&&empty item.aid)}">
							<span type="del"><a href="dcomment/${item.id}?pid=${aprobleam.id}" class="layui-btn layui-btn-danger layui-btn-small">删除</a></span>
									
						</c:if>
						
						<c:if test="${user.id==aprobleam.uid&&empty item.aid}">
							<span class="jieda-accept" type="accept">
									<a href="saveaccept/${item.id}?pid=${aprobleam.id}" class="layui-btn  layui-btn-small">采纳</a></span>
						</c:if>

						<c:out escapeXml="false" value='</div>'></c:out>
						<c:out escapeXml="false" value='</div></li>'></c:out>
						
					</c:forEach>
					
					
								
										<!-- 
                  <em style="color:#5FB878">(管理员)</em> -->

								

						<!-- <li class="fly-none">没有任何回答</li> -->
					</ul>
					
					
					
					
					<span id="toName">@${aprobleam.message.nickname}(楼主)</span>		
					<div class="layui-form layui-form-pane">
						<form action="addcomment/${aprobleam.id}" method="post">
							<div class="layui-form-item layui-form-text">
								<div class="layui-input-block">
										<textarea id="L_content" name="content" required
										lay-verify="required" placeholder="我要回答"
										class="layui-textarea fly-editor" style="height: 150px;"><%=request.getParameter("text")!=null?request.getParameter("text"):"" %></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<button class="layui-btn" lay-filter="*" lay-submit>提交回答</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>




		<div class="edge">
			<dl class="fly-panel fly-list-one">
				<dt class="fly-panel-title">最近热帖</dt>
					<c:forEach items="${firstnum}" var="item">
					<c:out escapeXml="false" value='<dd>'></c:out>
					<c:out escapeXml="false" value='<a href="detail/${item.id}">${item.title}</a>'></c:out>
					<c:out escapeXml="false" value='<span><i class="iconfont">&#xe60b;</i>${item.num}</span>'></c:out>
					<c:out escapeXml="false" value='</dd>'></c:out>
					</c:forEach>
			</dl>

			<dl class="fly-panel fly-list-one">
				<dt class="fly-panel-title">近期热议</dt>
				<c:forEach items="${firstcount}" var="item">
				
				
					<c:out escapeXml="false" value='<dd>'></c:out>
					<c:out escapeXml="false" value='<a href="detail/${item.id}">${item.title}</a> <span>'></c:out>
					<c:out escapeXml="false" value='<i class="iconfont">&#xe60c;</i>${item.count}</span>'></c:out>
					<c:out escapeXml="false" value='</dd>'></c:out>

				</c:forEach>
			</dl>
		</div>
	</div>
        <!-- -->
	</div>
	</body>
</html>
<!-- -- -->
<script type="text/javascript" charset="utf-8" src="file/res/js/kindeditor.js"></script>
  <!--  <script type="text/javascript">
    KE.show({
        id : 'L_content',
		resizeMode : 1,
        items : [
        'fontname', 'fontsize', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
        'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
        'insertunorderedlist', 'emoticons', 'image', 'link']
    });
  </script>-->
  
  <script>
							$(document).ready(function() {
								$("[type='zan']").click(function(){
									var thisspan=$(this)
									var likeid=Number($(this).data("likeid"));
									
									if(likeid==1){
    									$.post("dropLike",{"cid":$(this).data("cid")},function(result){
    										var num=Number(result);
    										
    										if(num==1){
    										thisspan.removeClass("zanok");
        									thisspan.children(".tempzan").html(Number(thisspan.children(".tempzan").html())-1);
        									thisspan.data("likeid", "2");
    									}else if(num==2){
    										alert("请登陆后操作!");
    									}else if(num==3){
    										alert("系统异常!");
    									}
    										
    									},"text")
    									alert(num);
    									
									
									
									}else if(likeid==2){

    								$.post("saveLike",{"cid":$(this).data("cid")},function(result){
    									var num=Number(result);
    									
    									if(num==1){
    										thisspan.addClass("zanok");
        									thisspan.children(".tempzan").html(Number(thisspan.children(".tempzan").html())+1);
        									thisspan.data("likeid", "1");
    									}else if(num==2){
    										alert("请登陆后操作!");
    									}else if(num==3){
    										alert("系统异常!");
    									}
    									
    									},"text")
        								
									
									}
									
								
								})
    							
							})
						</script>
<!-- 背景渲染 -->
<script id="sakura_point_vsh" type="x-shader/x_vertex">

uniform mat4 uProjection;

uniform mat4 uModelview;

uniform vec3 uResolution;

uniform vec3 uOffset;

uniform vec3 uDOF;  //x:focus distance, y:focus radius, z:max radius

uniform vec3 uFade; //x:start distance, y:half distance, z:near fade start



attribute vec3 aPosition;

attribute vec3 aEuler;

attribute vec2 aMisc; //x:size, y:fade



varying vec3 pposition;

varying float psize;

varying float palpha;

varying float pdist;



//varying mat3 rotMat;

varying vec3 normX;

varying vec3 normY;

varying vec3 normZ;

varying vec3 normal;



varying float diffuse;

varying float specular;

varying float rstop;

varying float distancefade;



void main(void) {

    // Projection is based on vertical angle

    vec4 pos = uModelview * vec4(aPosition + uOffset, 1.0);

    gl_Position = uProjection * pos;

    gl_PointSize = aMisc.x * uProjection[1][1] / -pos.z * uResolution.y * 0.5;

    

    pposition = pos.xyz;

    psize = aMisc.x;

    pdist = length(pos.xyz);

    palpha = smoothstep(0.0, 1.0, (pdist - 0.1) / uFade.z);

    

    vec3 elrsn = sin(aEuler);

    vec3 elrcs = cos(aEuler);

    mat3 rotx = mat3(

        1.0, 0.0, 0.0,

        0.0, elrcs.x, elrsn.x,

        0.0, -elrsn.x, elrcs.x

    );

    mat3 roty = mat3(

        elrcs.y, 0.0, -elrsn.y,

        0.0, 1.0, 0.0,

        elrsn.y, 0.0, elrcs.y

    );

    mat3 rotz = mat3(

        elrcs.z, elrsn.z, 0.0, 

        -elrsn.z, elrcs.z, 0.0,

        0.0, 0.0, 1.0

    );

    mat3 rotmat = rotx * roty * rotz;

    normal = rotmat[2];

    

    mat3 trrotm = mat3(

        rotmat[0][0], rotmat[1][0], rotmat[2][0],

        rotmat[0][1], rotmat[1][1], rotmat[2][1],

        rotmat[0][2], rotmat[1][2], rotmat[2][2]

    );

    normX = trrotm[0];

    normY = trrotm[1];

    normZ = trrotm[2];

    

    const vec3 lit = vec3(0.6917144638660746, 0.6917144638660746, -0.20751433915982237);

    

    float tmpdfs = dot(lit, normal);

    if(tmpdfs < 0.0) {

        normal = -normal;

        tmpdfs = dot(lit, normal);

    }

    diffuse = 0.4 + tmpdfs;

    

    vec3 eyev = normalize(-pos.xyz);

    if(dot(eyev, normal) > 0.0) {

        vec3 hv = normalize(eyev + lit);

        specular = pow(max(dot(hv, normal), 0.0), 20.0);

    }

    else {

        specular = 0.0;

    }

    

    rstop = clamp((abs(pdist - uDOF.x) - uDOF.y) / uDOF.z, 0.0, 1.0);

    rstop = pow(rstop, 0.5);

    //-0.69315 = ln(0.5)

    distancefade = min(1.0, exp((uFade.x - pdist) * 0.69315 / uFade.y));

}

</script>

<script id="sakura_point_fsh" type="x-shader/x_fragment">

#ifdef GL_ES

//precision mediump float;

precision highp float;

#endif



uniform vec3 uDOF;  //x:focus distance, y:focus radius, z:max radius

uniform vec3 uFade; //x:start distance, y:half distance, z:near fade start



const vec3 fadeCol = vec3(0.08, 0.03, 0.06);



varying vec3 pposition;

varying float psize;

varying float palpha;

varying float pdist;



//varying mat3 rotMat;

varying vec3 normX;

varying vec3 normY;

varying vec3 normZ;

varying vec3 normal;



varying float diffuse;

varying float specular;

varying float rstop;

varying float distancefade;



float ellipse(vec2 p, vec2 o, vec2 r) {

    vec2 lp = (p - o) / r;

    return length(lp) - 1.0;

}



void main(void) {

    vec3 p = vec3(gl_PointCoord - vec2(0.5, 0.5), 0.0) * 2.0;

    vec3 d = vec3(0.0, 0.0, -1.0);

    float nd = normZ.z; //dot(-normZ, d);

    if(abs(nd) < 0.0001) discard;

    

    float np = dot(normZ, p);

    vec3 tp = p + d * np / nd;

    vec2 coord = vec2(dot(normX, tp), dot(normY, tp));

    

    //angle = 15 degree

    const float flwrsn = 0.258819045102521;

    const float flwrcs = 0.965925826289068;

    mat2 flwrm = mat2(flwrcs, -flwrsn, flwrsn, flwrcs);

    vec2 flwrp = vec2(abs(coord.x), coord.y) * flwrm;

    

    float r;

    if(flwrp.x < 0.0) {

        r = ellipse(flwrp, vec2(0.065, 0.024) * 0.5, vec2(0.36, 0.96) * 0.5);

    }

    else {

        r = ellipse(flwrp, vec2(0.065, 0.024) * 0.5, vec2(0.58, 0.96) * 0.5);

    }

    

    if(r > rstop) discard;

    

    vec3 col = mix(vec3(1.0, 0.8, 0.75), vec3(1.0, 0.9, 0.87), r);

    float grady = mix(0.0, 1.0, pow(coord.y * 0.5 + 0.5, 0.35));

    col *= vec3(1.0, grady, grady);

    col *= mix(0.8, 1.0, pow(abs(coord.x), 0.3));

    col = col * diffuse + specular;

    

    col = mix(fadeCol, col, distancefade);

    

    float alpha = (rstop > 0.001)? (0.5 - r / (rstop * 2.0)) : 1.0;

    alpha = smoothstep(0.0, 1.0, alpha) * palpha;

    

    gl_FragColor = vec4(col * 0.5, alpha);

}

</script>

<!-- effects -->

<script id="fx_common_vsh" type="x-shader/x_vertex">

uniform vec3 uResolution;

attribute vec2 aPosition;



varying vec2 texCoord;

varying vec2 screenCoord;



void main(void) {

    gl_Position = vec4(aPosition, 0.0, 1.0);

    texCoord = aPosition.xy * 0.5 + vec2(0.5, 0.5);

    screenCoord = aPosition.xy * vec2(uResolution.z, 1.0);

}

</script>

<script id="bg_fsh" type="x-shader/x_fragment">

#ifdef GL_ES

//precision mediump float;

precision highp float;

#endif



uniform vec2 uTimes;



varying vec2 texCoord;

varying vec2 screenCoord;



void main(void) {

    vec3 col;

    float c;

    vec2 tmpv = texCoord * vec2(0.8, 1.0) - vec2(0.95, 1.0);

    c = exp(-pow(length(tmpv) * 1.8, 2.0));

    col = mix(vec3(0.02, 0.0, 0.03), vec3(0.96, 0.98, 1.0) * 1.5, c);

    gl_FragColor = vec4(col * 0.5, 1.0);

}

</script>

<script id="fx_brightbuf_fsh" type="x-shader/x_fragment">

#ifdef GL_ES

//precision mediump float;

precision highp float;

#endif

uniform sampler2D uSrc;

uniform vec2 uDelta;



varying vec2 texCoord;

varying vec2 screenCoord;



void main(void) {

    vec4 col = texture2D(uSrc, texCoord);

    gl_FragColor = vec4(col.rgb * 2.0 - vec3(0.5), 1.0);

}

</script>

<script id="fx_dirblur_r4_fsh" type="x-shader/x_fragment">

#ifdef GL_ES

//precision mediump float;

precision highp float;

#endif

uniform sampler2D uSrc;

uniform vec2 uDelta;

uniform vec4 uBlurDir; //dir(x, y), stride(z, w)



varying vec2 texCoord;

varying vec2 screenCoord;



void main(void) {

    vec4 col = texture2D(uSrc, texCoord);

    col = col + texture2D(uSrc, texCoord + uBlurDir.xy * uDelta);

    col = col + texture2D(uSrc, texCoord - uBlurDir.xy * uDelta);

    col = col + texture2D(uSrc, texCoord + (uBlurDir.xy + uBlurDir.zw) * uDelta);

    col = col + texture2D(uSrc, texCoord - (uBlurDir.xy + uBlurDir.zw) * uDelta);

    gl_FragColor = col / 5.0;

}

</script>

<!-- effect fragment shader template -->

<script id="fx_common_fsh" type="x-shader/x_fragment">

#ifdef GL_ES

//precision mediump float;

precision highp float;

#endif

uniform sampler2D uSrc;

uniform vec2 uDelta;



varying vec2 texCoord;

varying vec2 screenCoord;



void main(void) {

    gl_FragColor = texture2D(uSrc, texCoord);

}

</script>

<!-- post processing -->

<script id="pp_final_vsh" type="x-shader/x_vertex">

uniform vec3 uResolution;

attribute vec2 aPosition;

varying vec2 texCoord;

varying vec2 screenCoord;

void main(void) {

    gl_Position = vec4(aPosition, 0.0, 1.0);

    texCoord = aPosition.xy * 0.5 + vec2(0.5, 0.5);

    screenCoord = aPosition.xy * vec2(uResolution.z, 1.0);

}

</script>

<script id="pp_final_fsh" type="x-shader/x_fragment">

#ifdef GL_ES

//precision mediump float;

precision highp float;

#endif

uniform sampler2D uSrc;

uniform sampler2D uBloom;

uniform vec2 uDelta;

varying vec2 texCoord;

varying vec2 screenCoord;

void main(void) {

    vec4 srccol = texture2D(uSrc, texCoord) * 2.0;

    vec4 bloomcol = texture2D(uBloom, texCoord);

    vec4 col;

    col = srccol + bloomcol * (vec4(1.0) + srccol);

    col *= smoothstep(1.0, 0.0, pow(length((texCoord - vec2(0.5)) * 2.0), 1.2) * 0.5);

    col = pow(col, vec4(0.45454545454545)); //(1.0 / 2.2)

    

    gl_FragColor = vec4(col.rgb, 1.0);

    gl_FragColor.a = 1.0;

}

</script>